package com.bang.study;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author ${USER}
 * @ClassName: ${NAME}
 * @Desc: TODO
 * @Date: ${YEAR}/${MONTH}/${DAY} ${HOUR}:${MINUTE}
 * @Version: 1.0
 * @Modified By:
 */
public class Main {
    public static void main(String[] args) {
        List<Object> combos = new ArrayList<>();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 8; i++) {
            JSONObject jsonObject = new JSONObject();
            /**
             *  {
             *                 id: 'a',
             *                 label: 'Combo A',
             *             }
             */
            String e = "A" + i;
            list.add(e);
            jsonObject.put("id", e);
            jsonObject.put("label", "Combo " + e);
            combos.add(jsonObject);
        }

        JSONObject result = new JSONObject();
        List<Object> nodes = new ArrayList<>();
        for (int i = 0; i < 170; i++) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("id",""+i);
            Collections.shuffle(list);
            jsonObject.put("comboId",list.get(0));
            nodes.add(jsonObject);
        }


        result.put("nodes", nodes);
        result.put("combos", combos);

        System.out.println(result);
    }
}
